<template>
  <scroll-view scroll-y :style="{ height: `calc(100vh - 90rpx)` }">
    <basics-form ref="basicsForm" @submit="submit" :hiddenMustIcon="true" />
    <view style="height: 200rpx" />
  </scroll-view>
</template>

<script>
import basicsForm from "@/components/basics-form/basics-form.vue";

export default {
  components: {
    basicsForm,
  },
  data() {
    return {};
  },
  created(options) {
    this.initRules();
  },
  methods: {
    initRules() {
      let rules = [
        {
          title: "脑卒中类型",
          key: "ddd",
          type: "select",
          selectList: [
            { name: "一度脑梗 ", value: 0 },
            { name: "2度脑梗", value: 1 },
            { name: "3度脑梗", value: 2 },
          ],
          selectKey: "value",
          skip: true,
        },
        {
          title: "脑卒中确诊时间",
          key: "idCardStart",
          type: "selectDate",
          skip: true,
        },
        {
          title: "高血压类型",
          key: "ddxd",
          type: "select",
          selectList: [
            { name: "一度脑梗 ", value: 0 },
            { name: "2度脑梗", value: 1 },
            { name: "3度脑梗", value: 2 },
          ],
          selectKey: "value",
          skip: true,
        },
        {
          title: "高血压确诊时间",
          key: "idCarsdsdStart",
          type: "selectDate",
          skip: true,
        },
        {
          title: "并发症",
          key: "jkzd",
          type: "choose",
          selectList: [
            { name: "戒烟", value: 1 },
            { name: "限酒", value: 2 },
            { name: "限盐", value: 3 },
            { name: "限糖", value: 4 },
            { name: "加强锻炼", value: 5 },
            { name: "控制体重", value: 6 },
            { name: "老年人防跌倒", value: 7 },
            { name: "其他", value: 8 },
          ],
          selectKey: "value",
          selectInputByIndex: 7,
          selectInputKey: "other",
          selectInputValue: "",
          skip: true,
        },
        {
          title: "药物过敏史",
          key: "jkzd",
          type: "choose",
          selectList: [
            { name: "戒烟", value: 1 },
            { name: "限酒", value: 2 },
            { name: "限盐", value: 3 },
            { name: "限糖", value: 4 },
            { name: "加强锻炼", value: 5 },
            { name: "控制体重", value: 6 },
            { name: "老年人防跌倒", value: 7 },
            { name: "其他", value: 8 },
          ],
          selectKey: "value",
          selectInputByIndex: 7,
          selectInputKey: "other2",
          selectInputValue: "",
          skip: true,
        },
        {
          title: "残疾情况",
          key: "jkzd",
          type: "choose",
          selectList: [
            { name: "戒烟", value: 1 },
            { name: "限酒", value: 2 },
            { name: "限盐", value: 3 },
            { name: "限糖", value: 4 },
            { name: "加强锻炼", value: 5 },
            { name: "控制体重", value: 6 },
            { name: "老年人防跌倒", value: 7 },
            { name: "其他", value: 8 },
          ],
          value: [1, 7],
          selectKey: "value",
          selectInputByIndex: 7,
          selectInputKey: "other3",
          selectInputValue: "ww",
          skip: true,
        },
        {
          title: "是否有遗传病史",
          key: "ddd",
          type: "radio",
          selectList: [
            { name: "是 ", value: 1 },
            { name: "否", value: 0 },
          ],
          value: 1,
          selectKey: "value",
          skip: true,
        },
      ];
      this.$nextTick(() => {
        console.log(this.$refs.basicsForm);
        this.$refs.basicsForm.initForm(rules);
      });
    },
  },
};
</script>
